home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
001
/
sl.arc
/
SL.BAS
next >
Wrap
BASIC Source File
|
1987-08-28
|
2KB
|
63 lines
print "This program will allow you to write the date and time with a note to"
print "a file. The note (ex. payroll_for_H.M.CO._begun) and the filename"
print "should be added as command line arguments when running."
print ""
print "Questions or suggestions can be addressed to:"
print "Jerry A. Shenk"
print "SYSOP on LABB (717) 394-1357 3/12/2400 baud 8N1"
print ""
print ""
main:
cline$ = command$
length = len(cline$)
dim arg$(10)
gosub argsplit
gosub datline
gosub writefile
end
argsplit: ' subroutine to split cammand line
true = -1 : false = 0 ' define logical flags
i = 1 : num = 0 : inword = true
while i <= length
ch$ = mid$(cline$,i,1)
if ch$ <> " " then
if not inword then inword = true
arg$(num) = arg$(num) + ch$
elseif inword then
num = num + 1
inword = false
end if
i = i + 1
wend
return
datline:
if num = -1 then
print "You must give at least one argument from the DOS command line."
print "The syntax is:"
print " SL note_to_include_with_time filename"
print ""
print "The filename is optional. If deleted the note and the time "
print "be saved to a file called SL.PRE"
end
end if
td$ = date$ + " " + time$
datline$ = td$ + " " + arg$(0)
return
writefile:
if num > 0 then
datfile$ = arg$(1)
else
datfile$ = "SL.PRE"
end if
open "a",1,datfile$
print #1, datline$
close 1
return